package com.atzly.community.service;

import com.atzly.community.entity.LoginTicket;
import com.atzly.community.entity.User;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.Map;

/**  用户
 * @author zlysimida
 * @date 2021/8/24 - 12:58
 */

public interface UserService {

    User selectById(int id);

    User selectByName(String username);

    User selectByEmail(String email);

    int insertUser(User user);

    int updateStatus(int id, int status);

    int updateHeader(int id, String headerUrl);

    int updatePassword(int id, String password);

    Map<String,Object> registerService(User user);

    int activation(int userId,String code);

    Map<String, Object> login(String username, String password, int expiredSeconds);

    void logout(String ticket);

    LoginTicket selectTicketById(String ticket);

    Collection<? extends GrantedAuthority> getAuthorities(int userId);

}
